package server.model.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @description:
 * @author: 许哲
 * @createTime: 2021/11/22 18:52
 * @version: 1.0
 */
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@DynamicInsert
@DynamicUpdate
@ApiModel("资源控制表")
public class DyLog {
    @Id
    @GeneratedValue(generator = "NumberIdProduce")
    @GenericGenerator(name = "NumberIdProduce", strategy = "server.tool.idProduce.NumberIdProduce")
    private String id;

    private String dyOrder;

    private String log;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @LastModifiedDate
    @Column
    private Date modifiedTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @CreatedDate
    @Column
    private Date createTime;

    private String systemCode;
}
